import { createApp } from "vue";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import App from "./App.vue";
import router from "./router";

import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// 初始化css
// import "./style.css";

// 引入初始化样式文件
import "@/styles/common.scss";

// 引入懒加载插件
import { lazyPlugin } from "@/directives";

const app = createApp(App);

const pinia = createPinia();
//注册持久化插件
pinia.use(piniaPluginPersistedstate);

app.use(pinia);
app.use(router);
app.use(lazyPlugin);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.mount("#app");
